<template>
    <view>
        <view class="beijing">
            <view class="x hxfx1">
                <p>头像</p>
                <img :src="from.avatar" style="width: 100rpx;height: 100rpx;" />
            </view>
            <view class="x hxfx1" @click="nic">
                <p>昵称</p>
                <i>></i>
            </view>
            <view class="x hxfx1" @click="xingbie">
                <p>性别</p>
                <i>></i>
            </view>
            <view class="x hxfx1" @click="mima">
                <p>密码设置</p>
                <i>></i>
            </view>
            <view class="x hxfx1" @click="shojihao">
                <p>手机号</p>
                <i>></i>
            </view>
        </view>
        <view class="tuichu spcz" @click="deng">
            退出当前用户
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                from: {}
            }
        },
        onShow() {
            // this.user = uni.getStorageSync('user') //获取存储的token
            // this.$api.get('/wx/auth/info', this.from).then((res) => {
            //     console.log(res)
            //     this.from = res.data.data
            // })
        },
        methods: {
            deng() {
                uni.removeStorageSync('user') //删除token
                uni.reLaunch({ //删除成功跳转页面
                    url: '/pages/denglu/denglu'
                })
            },
            nic() {
                uni.navigateTo({
                    url: '/pages/shezhi/nic'
                })
            },
            xingbie() {

            },
            mima() {
                uni.navigateTo({
                    url: '/pages/shezhi/mima'
                })
            },
            shojihao() {
                uni.navigateTo({
                    url: '/pages/shezhi/shojihao'
                })
            }
        }
    }
</script>

<style>
    html {
        background: #f1f1f1;
    }

    .tuichu {
        width: 100%;
        height: 100rpx;
        background: #ffffff;
        margin-top: 50rpx;
    }

    .beijing {
        background: #ffffff;
    }

    .beijing view {
        height: 130rpx;
        display: flex;
        align-items: center;
        border-top: 1rpx solid #ededed;
        width: 92%;
        margin: auto;
    }

    .beijing i {
        width: 20rpx;
    }
</style>